package Demo1;

public class Test {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        Rect rect=new Rect();
        Cycle cycle=new Cycle();
        Triangle triangle=new Triangle();
        Shape[] shapes={cycle,rect,cycle,rect,triangle};
        for(Shape shape:shapes){
            shape.draw();
        }
    }
}
/*
父类的静态
子类的静态
父类的实例
父类的构造
子类的实例
子类的构造*/
